package com.wangsai.framework.supersecurity.example.cloud.client.controller;

import com.wangsai.framework.supersecurity.core.context.UserContext;
import com.wangsai.framework.supersecurity.example.cloud.commons.MyIUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Mr.Wang
 * @description
 * @date 2021-08-15 09:32
 */
@Api(tags = "用户测试模块")
@RestController
@RequestMapping("/user")
public class UserController {

    @ApiOperation(value = "获取登陆用户")
    @GetMapping("/info")
    public MyIUser info() {
        return UserContext.currentUser(MyIUser.class);
    }
}